<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>蓝牙电表项目</title>
    <!-- CSS -->
    <%--<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:400,100,300,500">--%>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/form-elements.css">
    <link rel="stylesheet" href="assets/css/style.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <!--<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>-->
    <%--<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>--%>
    <%--<![endif]-->--%>

    <!-- Favicon and touch icons -->
    <link rel="shortcut icon" href="assets/ico/favicon.png">
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
    <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<!-- Top menu -->
<nav class="navbar navbar-inverse navbar-no-bg" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#top-navbar-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">蓝牙电表项目</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="top-navbar-1">
            <%--<ul class="nav navbar-nav navbar-right">--%>
            <%--<li>--%>
            <%--<span class="li-text">--%>
            <%--Put some text or--%>
            <%--</span>--%>
            <%--<a href="#"><strong>links</strong></a>--%>
            <%--<span class="li-text">--%>
            <%--here, or some icons:--%>
            <%--</span>--%>
            <%--<span class="li-social">--%>
            <%--<a href="#"><i class="fa fa-facebook"></i></a>--%>
            <%--<a href="#"><i class="fa fa-twitter"></i></a>--%>
            <%--<a href="#"><i class="fa fa-envelope"></i></a>--%>
            <%--<a href="#"><i class="fa fa-skype"></i></a>--%>
            <%--</span>--%>
            <%--</li>--%>
            <%--</ul>--%>
        </div>
    </div>
</nav>

<!-- Top content -->
<div class="top-content">
    <div class="inner-bg">
        <div class="container">
            <div class="row">
                <div class="col-sm-7 text">
                    <h1><strong>智 慧 电 力</strong></h1>
                    <div class="description">
                        <p>
                            蓝牙电表平台<a href="#"><strong>-Ammeter</strong></a>
                        </p>
                    </div>
                    <%--<div class="top-big-link">--%>
                    <%--<a class="btn btn-link-1" href="#">Button 1</a>--%>
                    <%--<a class="btn btn-link-2" href="#">Button 2</a>--%>
                    <%--</div>--%>
                </div>
                <div class="col-sm-5 form-box">
                    <div class="form-top">
                        <div class="form-top-left">
                            <h3>密码登录</h3>
                        </div>
                        <div class="form-top-right">
                            <i class="fa fa-pencil"></i>
                        </div>
                        <div class="form-top-divider"></div>
                    </div>
                    <div class="form-bottom">
                        <form role="form" action="" method="post" class="registration-form">
                            <div class="form-group">
                                <label class="sr-only">登录名</label>
                                <input type="text" name="form-first-name" placeholder="登录名..."
                                       class="form-first-name form-control" id="loginName">
                            </div>
                            <div class="form-group">
                                <label class="sr-only">密码</label>
                                <input type="password" name="form-last-name" placeholder="密码..."
                                       class="form-last-name form-control" id="pwd" style="height: 50px;padding-left: 22px;">
                            </div>
                            <div class="btnDiv">
                                <div align="left" style="float:left;width: 100%">
                                    <button type="button" class="btn buttonA">登 录</button>
                                </div>
                                <%--<div align="right" style="float:right;width: 25%">--%>
                                    <%--<button type="button" class="btnA buttonB">注 册</button>--%>
                                <%--</div>--%>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>


<!-- Javascript -->
<script src="assets/js/jquery-1.11.1.min.js"></script>
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.backstretch.min.js"></script>
<script src="assets/js/retina-1.1.0.min.js"></script>
<script src="assets/js/scripts.js"></script>
<script src="assets/plugins/layui/layui.all.js"></script>
<script src="assets/js/common.js"></script>

<!--[if lt IE 10]>
<script src="assets/js/placeholder.js"></script>
<![endif]-->
<script>

</script>
</body>

</html>
<script>

    $(function () {
        var loginHeight = $(window).height() || $(document).height();
        $(".main").css({height: loginHeight + 'px'});
    });

    $(".buttonA").on("click", function () {
        var loginName = $("#loginName").val();
        var password = $("#pwd").val();
        if (isEmpty(loginName))
            return layer.tips("请输入用户名", "#loginName", {tips: [1, '#ff9800']});

        if (isEmpty(password))
            return layer.tips("请输入密码", "#pwd", {tips: [1, '#ff9800']});

        var url = "auth/loginSubmit";
        password = $.trim(password)
        postAjaxReqLogin(url, {
            "username": $.trim(loginName),
            "password": $.trim(password)
        }, function (res) {
            if (res.code == 1) {
                window.location.href = "index"
            } else {
                layer.msg(res.msg)
            }
        })
    });
    $("#pwd").bind("keyup", function (event) {
        if (event.keyCode == "13") {
            $('.buttonA').click();
        }
    })

    $(".buttonB").on("click", function () {
        location.href = "register";
    })
</script>
